/*
**
*/

#ifndef __PF_MWM_H__
#define __PF_MWM_H__

#ifndef WIN32
#ifndef INLINE
#define INLINE inline
#endif

#ifndef UINT64
#define UINT64 unsigned long long
#endif

#else
#ifndef INLINE
#define INLINE __inline
#endif

#ifndef UINT64
#define UINT64 __int64
#endif

#endif

#ifndef CDECL 
#define CDECL 
#endif


#define COPY_PATTERNS

/*
** Enables display of pattern group stats
*/



#define HASHBYTES16    2
#define HASH_TYPE     short


#include "tj_memfile.h"

/*
** PROTOTYPES
*/
void  mwm_reset( void * mwm_tree );

int  mwm_add_pattern_ex  ( void * mwm_tree, unsigned char * pattern, unsigned char pattern_len, unsigned int keyword_offset, unsigned int mask, unsigned char encode_type );

void mwm_large_shifts   ( void * mwm_tree, int flag );
int  mwm_prep_patterns  ( void * mwm_tree );

int  mwm_search( void *mwm_tree, unsigned char thread_id, unsigned char *search_text, int text_len, int( *action )(void * id, int index, void *data), void * data ); 

unsigned long long  mwm_get_pat_byte_count(unsigned char index);

void mwm_reset_byte_count(unsigned char index);

				
int   mwm_get_num_patterns( void * mwm_tree );

int  mwm_mem_file_search( void *mwm_tree, unsigned char thread_id,mem_file_item_t *mem_file, int file_offset, int text_len, int(*action )(void * id, int index, void *data), void * data ); 

#endif

